package lab02.test21;

public class Rate {

    //统计一个字符串中给定字符出现的频率。
    String str;
    char s;

    public static int count(String str, char s) {
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) == s) {
                count++;
            }
        }
        return count;
    }
}
